﻿using System.Configuration;
using System.Windows.Media;

namespace KyuuBackground
{
    public sealed class PictureConfigurationElement : ConfigurationElement
    {
        [ConfigurationProperty("source")]
        public string Source
        {
            get { return (string)this["source"]; }
            set { this["source"] = value; }
        }

        [ConfigurationProperty("scaleMode", DefaultValue = ScaleMode.Uniform)]
        public ScaleMode ScaleMode
        {
            get { return (ScaleMode)this["scaleMode"]; }
            set { this["scaleMode"] = value; }
        }

        [ConfigurationProperty("alignmentX", DefaultValue = HorizontalAlign.Right)]
        public HorizontalAlign AlignmentX
        {
            get { return (HorizontalAlign)this["alignmentX"]; }
            set { this["alignmentX"] = value; }
        }

        [ConfigurationProperty("alignmentY", DefaultValue = VerticalAlign.Bottom)]
        public VerticalAlign AlignmentY
        {
            get { return (VerticalAlign)this["alignmentY"]; }
            set { this["alignmentY"] = value; }
        }
    }

    public sealed class KyuuBackgroundConfigurationSection : ConfigurationSection
    {
        [ConfigurationProperty("opacity", DefaultValue = 0.5)]
        public double Opacity
        {
            get { return (double)this["opacity"]; }
            set { this["opacity"] = value; }
        }

        [ConfigurationProperty("picture")]
        public PictureConfigurationElement Picture
        {
            get { return (PictureConfigurationElement)this["picture"]; }
            set { this["picture"] = value; }
        }
    }
}
